public class LongDemo {
    public static void main(String[] args) {
        int a = 10;
        long b = 10;//long定义了长整型变量

        long c = 10L;//为了区分int 和long类型，一般建议将long类型变量的初始值之后加上L或者l
        long d = 20l;

        //long型表示的范围，远远超过int表示的范围。
        System.out.println(a);
        System.out.println(d);
        System.out.println(Long.MIN_VALUE);
        System.out.println(Long.MAX_VALUE);


        short a2 = 10;
        System.out.println(a2);
        System.out.println(Short.MIN_VALUE);
        System.out.println(Short.MAX_VALUE);

        //字节型变量：一个字节。
        byte b1 = 20;
        System.out.println(b);
        System.out.println(Byte.MIN_VALUE);
        System.out.println(Byte.MAX_VALUE);

        //浮点数变量；
        double d2 = 3.14;
        System.out.println(d2);

        int a3 = 1;
        int b2 = 2;
        System.out.println(a3/b2);

        double a4 = 1;
        double b3 = 2;
        System.out.println(a4/b3);

        double num = 1.1;
        System.out.println(num * num);//输出多少？

        float num2 = 1.0f; //写作1.0F也可以；
        System.out.println(num2);

        //字符型变量；
        char c1 = 'A'; //大写字母；
        char c2 = '1'; //数字字符

        System.out.println(c1);
        System.out.println(c2);

        //注意：Java中的字符可以存放整型；
        char c3 = '帅';
        System.out.println(c3);

        char ch = '呵';
        System.out.println(ch);

        //布尔变量；

        boolean b4 = true;
        System.out.println(b4);

        boolean b5 = false;
        System.out.println(b5);

        boolean value = true;
//        System.out.println(value + 1);

        //类型转换；
        int a5 = 10;
        long b6 = 100L;
        b6 = a5;
        a5 = (int) b6;

        System.out.println(a5);
        System.out.println(b6);


        System.out.println(1024);
        System.out.println(3.14);
//        int a6 = 100;
//        long b7 = 10l;
//        b7 = a6;
//        a6 = b7;
//
//        float f = 3.14;
//        double d3 = 5.12;
//
//        d3 = f;
//        f = d3;
//
//        System.out.println(Byte.MAX_VALUE);
//        
//        byte b7 = 100;
//        byte b8 = 257;
        //强制类型转换；
        int a6 = 10;
        long b9 = 100L;
        
        //范围由大到小，隐式转换
        b9 = a6;
        a6 = (int) b9;
        
        float f2 = 3.14F;
        double d3 = 5.12;
        d3 = f2;
        f2 = (float) d;
        
        boolean flag = true;
//         a11 = flag;
//        flag = a11;
    }


}
